Namespace - LJCNetCommon
Parameters
type - The object type.
data - The object reference.
namespaces - The XML namespaces.
Returns
The XML message string.
Syntax
C# |
public static String XmlSerializeToString(Type type, Object data, XmlSerializerNamespaces namespaces)
|
Serialize an object to an XML message string. (E)
Example
C# |
using LJCNetCommon;
public class Person
{
public long Id { get; set; }
public string Name { get; set; }
public bool PrincipleFlag { get; set; }
}
private static void XmlSerializeToString()
{
var person = new Person()
{
Id = 2,
Name = "Text",
PrincipleFlag = true
};
string message = NetCommon.XmlSerializeToString(person.GetType(), person, null);
Person newPerson;
newPerson = NetCommon.XmlDeserializeMessage(typeof(Person), message) as Person;
}
|
Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.